#ifndef BLOCKEDRADIX_H
#define BLOCKEDRADIX_H

#include <stdio.h>
#include <stdlib.h>
#include "FFTEngine.h"
#include "Complex.h"
#include "CommLayer.h"

class BlockedRadix : public FFTEngine {

public:
	
	/** Constructors **/
	BlockedRadix(int iNumPoints, CommLayer *iComm) : FFTEngine(iNumPoints,iComm) { } 


	/** FFT Driver functions **/
	virtual void distributeInitData(Complex *arr) { distributeData(arr,true,false,false); }
	virtual void aquireInitData() { distributeData(NULL,true,false,false); }
	
	virtual void acquireResultData(Complex *arr) { distributeData(arr,false,false,true); }
	virtual void distributeResultData() { distributeData(NULL,false,false,true); }

	virtual void executeFFT(); //computes the FFT in localData
	virtual void executeFFT(bool onlyComm);

private:
	
	virtual bool isLocal(int globalId) { return blocked_globalNode(globalId) == rank; }
	virtual int global2localId(int globalId) { return blocked_global2localId(globalId); }	
	virtual int globalNode(int globalId) { return blocked_globalNode(globalId); }	


};
#endif
